package com.hyt.it.ogt.ks.util;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author 刘恒活
 * @since 2021/8/3 15:41
 */
public class ComputerUtil {

    public static String SERVER_IP = null;

    public static String getServerIp() {
        if(SERVER_IP == null) {
            try {
                InetAddress localHost = InetAddress.getLocalHost();
                SERVER_IP = localHost.getHostAddress();
            } catch (UnknownHostException e) {
                e.printStackTrace();
            }
        }
        return SERVER_IP;
    }
}
